Skip to content

Add Hardware Home page#1456

Open
lordbagel42 wants to merge 7 commits into
hackclub:mainfrom
lordbagel42:hardware-home
Open

Add Hardware Home page#1456
lordbagel42 wants to merge 7 commits into
hackclub:mainfrom
lordbagel42:hardware-home

Conversation

@lordbagel42

@lordbagel42 lordbagel42 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

moved commits over from #1454. Current homepage is unfriendly to new hardware users, this PR adds a more friendly version of it at hackatime.hackclub.com/hardware

localhost_3000_hardware (4) (1)

@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a new /hardware landing page (HardwareHome/SignedOut) aimed at hardware makers, redirecting authenticated users to root and rendering the new Inertia page for guests. The page is structurally identical to the existing Home/SignedOut with hardware-focused copy and a new hero image.

  • The controller reuses set_homepage_seo_content, which hard-codes coding-oriented page titles and meta descriptions, so the hardware page will surface incorrect SEO tags to search engines and social platforms.
  • All eight subcomponents under HardwareHome/signedOut/ are near-duplicate copies of their Home/signedOut/ counterparts (differing by a few words), and AuthForm.svelte is included in the PR but never imported or used.

Confidence Score: 4/5

Safe to merge functionally, but the hardware page will always advertise itself to search engines and social platforms as a coding tracker, directly working against the page's purpose.

The controller reuses set_homepage_seo_content unchanged, so every visit to /hardware sends coding-focused title, og:title, and meta description tags — the wrong metadata for a page explicitly targeting hardware makers.

app/controllers/static_pages_controller.rb — the hardware action needs its own SEO content method rather than sharing the one written for the coding homepage.

Important Files Changed

Filename Overview
app/controllers/static_pages_controller.rb Adds hardware action that mirrors index for guests but reuses coding-focused SEO metadata, producing incorrect page titles and meta descriptions for the hardware-targeted page.
app/javascript/pages/HardwareHome/SignedOut.svelte Near-identical copy of Home/SignedOut.svelte with minor text swaps; duplicates all logic and layout rather than sharing components via props.
app/javascript/pages/HardwareHome/signedOut/AuthForm.svelte Added to PR but not imported in HardwareHome/SignedOut.svelte; dead code that mirrors Home/signedOut/AuthForm.svelte.
app/javascript/pages/HardwareHome/signedOut/HowItWorks.svelte Most meaningfully differentiated subcomponent — adds hardware/software tab switcher with distinct step copy; functionally correct.
config/routes.rb Adds GET /hardware route mapped to static_pages#hardware; straightforward and correct.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Browser
    participant Router as Rails Router
    participant Controller as StaticPagesController
    participant Cache as Cache::HomeStatsJob
    participant Inertia

    Browser->>Router: GET /hardware
    Router->>Controller: hardware()
    alt current_user present
        Controller-->>Browser: redirect_to root_path
    else guest
        Controller->>Controller: set_homepage_seo_content()
        Note over Controller: Sets coding-focused SEO tags
        Controller->>Cache: perform_now
        Cache-->>Controller: home_stats
        Controller->>Inertia: render HardwareHome/SignedOut
        Inertia-->>Browser: HTML + props
    end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Browser
    participant Router as Rails Router
    participant Controller as StaticPagesController
    participant Cache as Cache::HomeStatsJob
    participant Inertia

    Browser->>Router: GET /hardware
    Router->>Controller: hardware()
    alt current_user present
        Controller-->>Browser: redirect_to root_path
    else guest
        Controller->>Controller: set_homepage_seo_content()
        Note over Controller: Sets coding-focused SEO tags
        Controller->>Cache: perform_now
        Cache-->>Controller: home_stats
        Controller->>Inertia: render HardwareHome/SignedOut
        Inertia-->>Browser: HTML + props
    end
Loading

Reviews (2): Last reviewed commit: "Merge branch 'main' into hardware-home" | Re-trigger Greptile

Comment thread config/routes.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants